/*
 *	ApOS (Another Project software for s3c2410)
 *	
 *	This program is free software; you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License version 2 as
 *	published by the Free Software Foundation.
 *			
 *
 */
#ifndef _MEMORY_H
#define _MEMORY_H

#define BANK0	0
#define BANK1	1
#define BANK2	2
#define BANK3	3
#define BANK4	4
#define BANK5	5
#define BANK6	6
#define BANK7	7

/*
 *	about BWSCON register
 */
#define DW0_OFFSET	1
#define ST1_OFFSET	7
#define WS1_OFFSET	6
#define DW1_OFFSET	4
#define ST2_OFFSET	11
#define WS2_OFFSET	10
#define DW2_OFFSET	8
#define ST3_OFFSET	15
#define WS3_OFFSET	14
#define DW3_OFFSET	12
#define ST4_OFFSET	19
#define WS4_OFFSET	18
#define DW4_OFFSET	16
#define ST5_OFFSET	23
#define WS5_OFFSET	22
#define DW5_OFFSET	20
#define ST6_OFFSET	27
#define WS6_OFFSET	26
#define DW6_OFFSET	24
#define ST7_OFFSET	31
#define WS7_OFFSET	30
#define DW7_OFFSET	28

/*
 *	about BANK CONTROL register
 */
#define MT_OFFSET	15
#define TACS_OFFSET	13
#define TCOS_OFFSET	11
#define TACC_OFFSET	8
#define TCOH_OFFSET	6
#define TCAH_OFFSET	4
#define TACP_OFFSET	2
#define PMC_OFFSET	0
#define TRCS_OFFSET	2
#define SCAN_OFFSET	0

struct memory_ctrl_object
{
	volatile unsigned int *bwscon;
	volatile unsigned int *bankcon0;
	volatile unsigned int *bankcon1;
	volatile unsigned int *bankcon2;
	volatile unsigned int *bankcon3;
	volatile unsigned int *bankcon4;
	volatile unsigned int *bankcon5;
	volatile unsigned int *bankcon6;
	volatile unsigned int *bankcon7;
	volatile unsigned int *refresh;
	volatile unsigned int *banksize;
	volatile unsigned int *mrsrb6;
	volatile unsigned int *mrsrb7;
};

#endif
